package com.ms.service.module.fish.message.server;

import java.nio.ByteBuffer;
import java.util.List;

import com.ms.service.module.fish.game.FishDesk;
import com.ms.service.module.fish.game.Rank;
import com.ms.service.module.fish.message.FishBaseMessage;

/**
 * 房间奖励
 * @author cuiwm
 */
public class RoomRewardMessage extends FishBaseMessage{
	
    private FishDesk desk;
    
    public RoomRewardMessage(FishDesk desk) {
    	this.desk = desk;
	}

	@Override
	public void writeBody(ByteBuffer buf) {
		List<Rank> ranks = desk.getRanks();
		buf.putInt(desk.getId());
		buf.putInt(ranks.size());
		for(Rank rank:ranks){
			buf.putInt(rank.getFishId());
			buf.putInt(rank.getRate());
		}
	}


}